<?php

namespace StarCloud\Library;

use Framework\DiServices\HttpClient;
use Nette\Mail\DkimSigner;
use Nette\Mail\Message;
use Nette\Mail\SmtpMailer;
use Phalcon\Di;

class EmailSender
{

    protected $mailer;
    public function __construct()
    {
        $mailer = new SmtpMailer(
             [
                'host' => 'smtp.exmail.qq.com',
                'username' => 'fengshuang@doumvips.com',
                'password' => 'koqbM4MDwQ5zv7xY',
                'secure' => 'ssl',
            ]
        );
        $this->mailer = $mailer;
    }

    public function sendMailer($to, $subject, $body)
    {
        $mail = new Message();
        $mail->setFrom("resource@doumvips.com")
            ->addTo($to)
            ->setSubject($subject)
            ->setHtmlBody($body);
        $this->mailer->send($mail);
    }
}